-
Notifications
You must be signed in to change notification settings - Fork 1
Pre post #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Pre post #2
Conversation
src/vcy/vcy_parser.mly
Outdated
| | ASSUME e=exp SEMI { loc $startpos $endpos @@ Assume e } | ||
| | HAVOC i=IDENT SEMI { loc $startpos $endpos @@ Havoc i } | ||
| | variant=commute_variant phi=commute_condition | ||
| LBRACE PRE COLON pre=exp blocks=nonempty_list(block) POST COLON post=exp RBRACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge this rule with the above rule while making the parsing of the pre/post an Option.
src/vcy/ast.ml
Outdated
| | Assume of exp node | ||
| | Havoc of id | ||
| | Require of exp node | ||
| | GCommute of commute_variant * commute_condition * commute_pre_cond * block node list * commute_post_cond |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Commute of commute_variant * commute_condition * block node list * commute_pre_cond option * commute_post_cond option
| end | ||
| | Assume _ | Havoc _ -> | ||
| env, None (* We simply ignore 'assume's and 'havoc's at runtime *) | ||
| (* | GCommute (variant, phi, pre, blocks, post) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does GCommute just error on runtime? (Should be fixed if we merge with the Commute case as noted before).
Semantics for pre/post conditions? Do we want those to behave like assumptions/assertions and error if they aren't satisfied?
| | (* empty *) { loc $startpos $endpos @@ [] } | ||
| | ELSE b=block { b } | ||
| | ELSE ifs=if_stmt { loc $startpos $endpos @@ [ ifs ] } | ||
| | ELSE ifs=if_stmt { loc $startpos $endpos @@ [ ifs ] } No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a trailing endline
add pre and post-condition in veracity parser and its translation to Servois spec